<?php
/**
 * Created by PhpStorm.
 * User: zoupeng
 * Date: 2019-02-21
 * Time: 23:02
 */

namespace app\index\model;

use think\exception\ErrorException;
use think\Log;
use think\Model;
class Nav extends Model
{
    /**
     * 导航栏菜单栏列表
     * @return false|\PDOStatement|string|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function findNavList(){
        try{
            $navList = $this->where('show',1)->order('sort asc')->select();
            return $navList;
        }catch(ErrorException $e){
            Log::write('获取导航栏数据异常，错误'.$e->getMessage(),'error');
        }
    }
}